package com.dmpp.captcha;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author 北橙
 * @Create 2022/6/13
 * @Description 默认描述
 */
public interface CaptchaService {
    /**
     * 获取验证码
     *
     * @param request  HttpServletRequest
     * @param response HttpServletResponse
     * @throws IOException
     */
    void getCaptcha(HttpServletRequest request, HttpServletResponse response) throws IOException;

    /**
     * 检查验证码
     *
     * @param verificationAccount 账号
     * @param verificationCode    验证码
     * @return 返回 如果校验成功true 否则是 false
     */
    boolean checkCaptcha(String verificationAccount, String verificationCode);

    /**
     * 检查验证码
     *
     * @param request HttpServletRequest
     * @return 返回 如果校验成功true 否则是 false
     */
    boolean checkCaptcha(HttpServletRequest request);

    /**
     * 检查验证码
     *
     * @param verificationCode 验证码
     * @return 返回 如果校验成功true 否则是 false
     */
    boolean checkCaptcha(String verificationCode);
}
